{extend name="./public/base" /}
{block name="title"}个人资料{/block}
{block name="style"}
<style type="text/css">
	.content{
		width: 100%;
		background-color:#fff;
		font-size: 32px;
		color: #6e5858;
	}
	.top{
		width: 100%;
	    background-color: #ffba58;;
	    height: 80px;
	    color: #fff;
	    text-align: center;
	    line-height: 80px;
	    font-size: 32px;
	}
	.back{
		float: left;
	    margin-top: 14px;
	    padding-left: 10px;
	}
	.photo{
		width: 90%;
	   /* height: 29%;*/
	   	height:600px;
	    background-color: #f3f1f114;
	    margin: auto;
	    border-radius: 15px;
	    box-shadow: 0px 5px 2px 2px #f3f1f1f5;
	}
	.weui-uploader__input-box1{
		width: 29%;
	    height: 250px;
	    margin-top: 30px;
	    margin-left: 25px;
	    float: left;
	    border: 1px solid #f7dbdb;
	}
	.weui-uploader__input-box{
		width: 29%;
	    height: 250px;
	    margin-top: 30px;
	    margin-left: 22px;
	}
	.tags{
		width: 90%;
	    background-color: #f3f1f114;
	    margin: auto;
	    border-radius: 15px;
	    box-shadow: 0px 5px 2px 2px #f3f1f1f5;
	    color:#8c90a6;
	    font-size: 32px;
	}
	.tags_line1{
		margin-top: 40px;
		padding-top: 40px;
		color: #8c90a6;
		font-size:32px;
	}
	.tags_line1 span{
		display: inline-block;
	}
	.tags_line1 .my_tag{
		padding-left: 40px;
	}
	.tags_line1 .tag_more{
		padding-right: 60px;
    	float: right;
	}
	.tag_more a{
		color:#8c90a6;
	}
	.line{
		height: 2px;
	    background-color: #edecec;
	    margin: 40px auto;
	    width: 90%;
	}
	.tags .tag_chose{
		padding-bottom: 40px;
	}
	.tags .tag_chose span{
		display: inline-block;
		padding: 0 30px;
		border-radius: 20px;
		margin-left: 30px;
		background-color: #ffba58;
		color:#524242;
		margin-top: 20px;
	}
	
	.info{
		width: 90%;
	    background-color: #f3f1f114;
	    margin: auto;
	    border-radius: 15px;
	    box-shadow: 0px 5px 2px 2px #f3f1f1f5;
	}
	.info_list{
		width: 90%;
		color: #8c90a6;
    	font-size: 32px;
	}
	.info_list .item{ 
		
	}

	.info_list .item span{
	 	display: inline-block;
	}
	.info_list .item .lable{
	 width: 40%;
	 padding-left: 45px;
	}
	.info_list .item .value{
	 width: 50%;
	}
   	
   	.info .tags_line1 .my_tag{
   		width: 33%;
   		text-align: center;
   		padding-left: 0;
   		padding-bottom:40px;
   	}

   	.active{
   		border-bottom: 3px solid #ffba58;
   		color:#ffba58;
   	}

   	.show{
   		display: block;
   	}
   	.hide{
   		display: none;
   	}

   	.button{
		height:80px;
		background-color: #ffba58;
		color:#fff;
		text-align: center;
		line-height: 80px;
		width:90%;
		margin:20px auto;
		border-radius: 40px;
   	}

   	/*预览*/
   	.weui-gallery__opr {
	    position: absolute;
	    right: 0;
	    bottom: 57px;
	    left: 0;
	    background-color: #0d0d0d;
	    color: #fff;
	    line-height: 60px;
	    text-align: center;
	}

	.weui-icon-delete.weui-icon_gallery-delete {
	    color: #fff;
	    font-size: 60px;
	}
	.weui-dialog{
		width: 100%;
		height: 50%;
	}

</style>
{/block}
{block name="main"}
	<div id="app_content" class="content"> 
		<div class="top" >
			<span class="back"><img onclick="javascript:history.back(-1);" src="__STATIC__/images/back5.png" alt=""></span>
			<span>{{text11}}</span>
		</div>
		<div class="photo">
          	<div class="weui-uploader">
                <div class="weui-uploader__bd">
                    <ul class="weui-uploader__files" id="uploaderFiles">
                    	<div v-for="img in images" class="weui-uploader__input-box1" id="" :style="{backgroundImage: 'url('+img+')'}" style="background-size:100% 100%;background-repeat:no-repeat;">
                    	</div>
                    </ul>
                    <div class="weui-uploader__input-box">
                        <input id="uploaderInput" class="weui-uploader__input" type="file"  accept="image/jpg,image/jpeg,image/png,image/gif"  multiple="">
                    </div>
                </div>
            </div>
            <div class="weui-gallery" id="gallery">
		        <span class="weui-gallery__img" id="galleryImg"></span>
		        <div class="weui-gallery__opr">
		            <a href="javascript:" class="weui-gallery__del">
		                <i class="weui-icon-delete weui-icon_gallery-delete"></i>
		            </a>
		        </div>
		    </div>
		</div>
		<div class="tags">
			<div class="tags_line1"><span class="my_tag">我的标签</span><span class="tag_more"><a href="{:url('tags')}"><img style="width: 60px;height: 60px;" src="__STATIC__/images/d_arrow.png" alt=""></a></span></div>
			<div class="line"></div>
			<div class="tag_chose">
				<span class="list" v-for="tag in tags_name">{{tag}}</span>
			</div>
		</div>
		<div class="info">
			<div class="tags_line1"><span class="my_tag info_show active">基本资料</span><span class="my_tag info_show">择偶条件</span><span class="my_tag info_show">其他资料</span></div>
		    <div class="line"></div>
			<div class="info_list">
				<div class="my_info show">
					<div class="item">
					<span class="lable">生日:</span><span class="value"><input class="weui-input" type="text" id="birthday" v-model="birthday" readonly="readonly"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">身高(cm):</span><span class="value"><input class="weui-input" type="text" id="height" v-model="height"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">体重(kg):</span><span class="value"><input class="weui-input" type="text" id="weight" v-model="weight"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">星座:</span><span class="value"><input class="weui-input" type="text" id="zodiac" v-model="zodiac_data_standar[zodiac_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">学历:</span><span class="value"><input class="weui-input" type="text" id="education" v-model="education_data_standar[education_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">籍贯:</span><span class="value"><input class="weui-input" type="text" id="birth_city" v-model="birth_city"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">现居:</span><span class="value"><input class="weui-input" type="text" id="live_city" v-model="live_city"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">婚况:</span><span class="value"><input class="weui-input" type="text" id="marriage" v-model="marriage_data_standar[marriage_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">收入(元):</span><span class="value"><input class="weui-input" type="text" id="income" v-model="income_data_standar[income_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">职业:</span><span class="value"><input class="weui-input" type="text" id="worker" v-model="worker_data_standar[worker_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">房产:</span><span class="value"><input class="weui-input" type="text" id="house" v-model="house_data_standar[house_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">车辆:</span><span class="value"><input class="weui-input" type="text" id="car" v-model="car_data_standar[car_id]"></span>
					</div>
					<div class="line"></div>
				</div>
				<div class="my_mate hide">
					<div class="item">
					<span class="lable">年龄:</span><span class="value"><input class="weui-input" type="text" id="m_age" v-model="age_data_standar[m_age_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">身高(cm):</span><span class="value"><input class="weui-input" type="text" id="m_height" v-model="height_data_standar[m_height_id]"></span>
					</div>
					<!-- <div class="line"></div>
					<div class="item">
						<span class="lable">体重(kg):</span><span class="value"><input class="weui-input" type="text" id="weight" v-model="m_weight_id"></span>
					</div> -->
					<div class="line"></div>
					<div class="item">
						<span class="lable">学历:</span><span class="value"><input class="weui-input" type="text" id="m_education" v-model="education_data_standar[m_education_id]"></span>
					</div>
					<!-- <div class="line"></div>
					<div class="item">
						<span class="lable">地域:</span><span class="value"><input class="weui-input" type="text" id="live_city" v-model="live_city"></span>
					</div> -->
					<div class="line"></div>
					<div class="item">
						<span class="lable">婚况:</span><span class="value"><input class="weui-input" type="text" id="m_marriage" v-model="marriage_data_standar[m_marriage_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">收入(元):</span><span class="value"><input class="weui-input" type="text" id="m_income" v-model="income_data_standar[m_income_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">房产:</span><span class="value"><input class="weui-input" type="text" id="m_house" v-model="house_data_standar[m_house_id]"></span>
					</div>
					<div class="line"></div>
					<div class="item">
						<span class="lable">车辆:</span><span class="value"><input class="weui-input" type="text" id="m_car" v-model="car_data_standar[m_car_id]"></span>
					</div>
					<div class="line"></div>
				</div>

				<div class="my_other hide">
					<div class="item" v-for="ques in question">
					<span class="lable" style="display: block;">{{ques.title}}?</span><span class="value" style="display: block; width:88%;margin: auto;"> <input class="weui-input" type="text" 
						placeholder="请输入" v-model="ques.answer"></span>
					<div class="line"></div>
					</div>
				</div>
				
			</div>
		</div>

		<div class="button" @click="submit">保存资料</div>
	</div>
{/block}
{block name="script"}
<script type="text/javascript" >
    $(document).ready(function(){ 
		var host = "http://"+document.domain+"/api.php/";
		var imgs = new Array();
		var vm  = new Vue({
			el: '#app_content',
			data: {
				images:[],
				question_f:[],
			    question: [],
			    tags_name:[],
			    tags_ids:[],
			    text11:'个人信息',
			    birthday:'',
				height:'',
				weight:'',
				zodiac_data_standar:[],
				zodiac_data:[],
				zodiac_id:'',
				education_data_standar:[],
				education_data:[],
				education_id:'',
				birth_city:'',
				live_city:'',
				marriage_data_standar:[],
				marriage_data:[],
				marriage_id:'',
				income_data_standar:[],
				income_data:[],
				income_id:'',
				worker_data_standar:[],
				worker_data:[],
				worker_id:'',
				house_data_standar:[],
				house_data:[],
				house_id:'',
				car_data_standar:[],
				car_data:[],
				car_id:'',
				age_data_standar:[],
				age_data:[],
				m_age_id:'',
				height_data_standar:[],
				height_data:[],
				m_height_id:'',
				m_weight_id:'',
				m_education_id:'',
				m_marriage_id:'',
				m_income_id:'',
				m_house_id:'',
				m_car_id:'',
			},
		    methods:{
		    	get_user_info:function(){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'member/user_info',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'question'},
		        		success:function(data){
		        			if(data.code == 1){
		        				t.images = data.data.member_data.images;
		        				t.birthday = data.data.member_data.birthday;
		        				t.height = data.data.member_data.height;
		        				t.weight = data.data.member_data.weight;
		        				t.zodiac_id = data.data.member_data.zodiac_id;
		        				t.marriage_id = data.data.member_data.marriage_id; 
		        				t.income_id = data.data.member_data.income_id;
		        				t.house_id = data.data.member_data.house_id;
		        				t.car_id = data.data.member_data.car_id;
		        				t.education_id = data.data.member_data.education_id;
		        				t.worker_id = data.data.member_data.worker;
		        				t.live_city = data.data.member_data.live_city;
		        				t.birth_city = data.data.member_data.birth_city;
		        				/*要求*/
		        				if(data.data.m_member_data!=''){
		        					t.m_age_id = data.data.m_member_data.age_id; 
			        				t.m_car_id = data.data.m_member_data.car_id;
			        				t.m_education_id = data.data.m_member_data.education_id;
			        				t.m_height_id = data.data.m_member_data.height_id;
			        				t.m_house_id = data.data.m_member_data.house_id;
			        				t.m_income_id = data.data.m_member_data.income_id;
			        				t.m_marriage_id = data.data.m_member_data.marriage_id;
			        				t.question_f = data.data.m_member_data.question;
			        				console.log('问题f'); 
			        				console.log(t.question_f);
		        				}
		        			}

		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getQuestionList:function(){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'question'},
		        		success:function(data){
		        			if(data.code == 1){
		        				t.question = data.data.data1;
		        				if(t.question_f){
		        					t.question = t.question_f;
		        				}
		        			}
		        			console.log('问题');
		        			//console.log(t.question_f);
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getTagList:function(){
		        	var t = this;
		        	$.ajax({
		        		url: host+'Cate/my_tag',
		        		type: 'post',
		        		dataType: 'json',
		        		success:function(data){
		        			console.log(1234343);
		        			console.log(data);
		        			if(data.code == 1){
		        				t.tags_name = data.data.tags_name;
		        				t.tags_ids = data.data.tags_ids;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getZodiacList:function(){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'zodiac'},
		        		success:function(data){
		        			if(data.code == 1){
								zodiac_data =  JSON.parse(JSON.stringify(data.data.data1));
								zodiac_data_standar = JSON.parse(JSON.stringify(data.data.data));
								t.zodiac_data = zodiac_data;
								t.zodiac_data_standar = zodiac_data_standar;
								console.log(t.zodiac_data);console.log(t.zodiac_data_standar);
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getEducationList:function(){
		        	var id = event.target.id;
                    console.log(event.target.id);
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'education'},
		        		success:function(data){
		        			if(data.code == 1){
	        					education_data =  JSON.parse(JSON.stringify(data.data.data1));
	        					education_data_standar = JSON.parse(JSON.stringify(data.data.data));
	        					t.education_data = education_data;
	        					t.education_data_standar = education_data_standar;	
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getMarriageList:function(){
		        	var id = event.target.id;
                    console.log(event.target.id);
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'marriage'},
		        		success:function(data){
		        			if(data.code == 1){
		        				marriage_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				marriage_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.marriage_data = marriage_data;
		        				t.marriage_data_standar = marriage_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getIncomeList:function(){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'income'},
		        		success:function(data){
		        			if(data.code == 1){
		        				income_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				income_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.income_data = income_data;
		        				t.income_data_standar = income_data_standar;
		        				//console.log(income_data);console.log(24324);
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getWorkerList:function(){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'work'},
		        		success:function(data){
		        			if(data.code == 1){
		        				worker_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				worker_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.worker_data = worker_data;
		        				t.worker_data_standar = worker_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getCarList:function(event){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'car'},
		        		success:function(data){
		        			if(data.code == 1){
		        				car_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				car_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.car_data = car_data;
		        				t.car_data_standar = car_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getHouseList:function(event){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'house'},
		        		success:function(data){
		        			if(data.code == 1){
		        				house_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				house_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.house_data = house_data;
		        				t.house_data_standar = house_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },

		        getHeightList:function(event){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'height'},
		        		success:function(data){
		        			if(data.code == 1){
		        				height_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				height_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.height_data = height_data;
		        				t.height_data_standar = height_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },
		        getAgeList:function(event){
		        	var t = this;
		        	$.ajax({
		        		async:false,
		        		url: host+'Cate/param',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {table:'age'},
		        		success:function(data){
		        			if(data.code == 1){
		        				age_data =  JSON.parse(JSON.stringify(data.data.data1));
		        				age_data_standar = JSON.parse(JSON.stringify(data.data.data));
		        				t.age_data = age_data;
		        				t.age_data_standar = age_data_standar;
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        },

		        submit:function(event){
		        	var t = this;
		        	console.log(t.images);

		        	var question = t.question;
		        	var images = t.images;
		        	var birthday = t.birthday;
					var height = t.height;
					var weight = t.weight;
					var zodiac_id = t.zodiac_id;
					var education_id = t.education_id;
					var birth_city = t.birth_city;
					var live_city = t.live_city;
					var marriage_id = t.marriage_id;
					var income_id = t.income_id;
					var worker_id = t.worker_id;
					var house_id = t.house_id;
					var car_id = t.car_id;
					var m_age_id = t.m_age_id;
					var m_height_id = t.m_height_id;
					var m_weight_id = t.m_weight_id;
					var m_education_id = t.m_education_id;
					var m_marriage_id = t.m_marriage_id;
					var m_income_id = t.m_income_id;
					var m_house_id = t.m_house_id;
					var m_car_id = t.m_car_id;
					var json_str = {'birthday':birthday,'height':height,"weight":weight,'zodiac_id':zodiac_id,'education_id':education_id,'birth_city':birth_city,"live_city":live_city,'marriage_id':marriage_id,'income_id':income_id,'worker':worker_id,'house_id':house_id,'car_id':car_id};
					var m_json_str = {'age_id':m_age_id,'height_id':m_height_id,'weight_id':m_weight_id,'education_id':m_education_id,'marriage_id':m_marriage_id,'income_id':m_income_id,'house_id':m_house_id,'car_id':m_car_id};
					console.log('问题');
					console.log(question);
					if(images.length == 0){
						$.toast("请上传图片","text");
						return;
					}
					if(birthday == ''){
						$.toast("请选择出生年月","text");
						return;
					}
					if(height == ''){
						$.toast("请选择身高","text");
						return;
					}
					if(weight == ''){
						$.toast("请选择体重","text");
						return;
					}
					if(zodiac_id == ''){
						$.toast("请选择星座","text");
						return;
					}
					if(education_id == ''){
						$.toast("请选择学历","text");
						return;
					}
					if(birth_city == ''){
						$.toast("请选择出生城市","text");
						return;
					}
					if(live_city == ''){
						$.toast("请选择居住城市","text");
						return;
					}
					if(marriage_id == ''){
						$.toast("请选择婚姻情况","text");
						return;
					}
					if(income_id == ''){
						$.toast("请选择收入情况","text");
						return;
					}
					if(worker_id == ''){
						$.toast("请选择工作情况","text");
						return;
					}
					if(house_id == ''){
						$.toast("请选择房产情况","text");
						return;
					}
					if(car_id == ''){
						$.toast("请选择车辆情况","text");
						return;
					}
					if(m_age_id == ''){
						$.toast("请选择择偶年龄","text");
						return;
					}
					if(m_height_id == ''){
						$.toast("请选择择偶身高","text");
						return;
					}
					if(m_education_id == ''){
						$.toast("请选择择偶教育程度","text");
						return;
					}
					if(m_marriage_id == ''){
						$.toast("请选择择偶婚姻情况","text");
						return;
					}
					if(m_income_id == ''){
						$.toast("请选择择偶收入情况","text");
						return;
					}
					if(m_house_id == ''){
						$.toast("请选择择偶房产情况","text");
						return;
					}
					if(m_car_id == ''){
						$.toast("请选择择偶车辆情况","text");
						return;
					}
					$.ajax({
		        		url: host+'member/sub_info',
		        		type: 'post',
		        		dataType: 'json',
		        		data: {'json_str':JSON.stringify(json_str),'m_json_str':JSON.stringify(m_json_str),'images':JSON.stringify(images),'question':JSON.stringify(question)},
		        		success:function(data){
		        			$.toast(data.msg,"text");
		        			return;
		        			if(data.code == 1){
		        				setTimeout(function(){
                                  window.location.href = "{:url('info')}";
                              	}, 3000);
		        			}
		        		},
		        		error:function(e){
		        			console.log('error'+e);
		        		}
		        	})	
		        	console.log(json_str);
		        	console.log(m_json_str);
		        },
		    },
		    mounted: function () {
		    	this.get_user_info();
	    		this.getQuestionList();
	    		this.getTagList();
	    		this.getZodiacList();
	    		this.getEducationList();
	    		this.getMarriageList();
	    		this.getIncomeList();
	    		this.getWorkerList();
	    		this.getCarList();
	    		this.getHouseList();
	    		this.getHeightList();
	    		this.getAgeList();
	        }

		})

		/*
		组件
		 */
    	$("#birthday").datetimePicker({
			times:function(){
				return [{
					values:[]
				}];
			},
			onChange: function(result){
	        	var birthday = result.value.join('-');
	        	console.log('生日');
	        	console.log(birthday);
	        	vm.birthday = birthday;
	        	console.log(vm.birthday);
    		}, 
		});

		$("#height").select({
		  	title: "请选择您的身高",
		 	items: ['150','151','152','153','154','155','156','157','158','159','160', '161','162','163','164','165','166','167','168','169','170', '171','172','173','174','175','176','177','178','179','180', '181','182','183','184','185','186','187','188','189','190', '191','192','193','194','195','196','197','198','199'] ,
		 	onChange: function(result){
		    	vm.height = result.values;
			},
		});

		$("#weight").select({
		    title: "请选择您的体重",
		    items: ['40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99'] ,
		    onChange: function(result){
            	vm.weight = result.values;
        	}, 
		});

		$("#zodiac").select({
		  	title: "请选择您的星座",
		  	items: vm.zodiac_data,
		  	onChange: function(result){
            	console.log(124332);
            	console.log(result.values);
            	vm.zodiac_id = result.values;
        	},
		});

		$("#education").select({
		    title: "请选择您的学历",
		    items: vm.education_data,
		    onChange: function(result){
            	vm.education_id = result.values;
        	},
		});

		$("#m_education").select({
		    title: "请选择您的学历",
		    items: vm.education_data,
		    onChange: function(result){
            	vm.m_education_id = result.values;
        	},
		});

    	$("#birth_city").cityPicker({
		    title: "请选择您的籍贯",
		    onChange: function(result){
	        	console.log(result.displayValue);
	        	var birthCity = result.displayValue.join('-');
	        	vm.birth_city = birthCity;
    		}, 
		});
    
    	$("#live_city").cityPicker({
		    title: "请选择您的现居",
		    onChange: function(result){
	        	console.log(result.displayValue);
	        	var liveCity = result.displayValue.join('-');
	        	vm.live_city = liveCity;
    		}, 
		});

    	$("#marriage").select({
		    title: "请选择您的婚况",
		    items: vm.marriage_data,
		    onChange: function(result){
				vm.marriage_id = result.values;
        	},
		});

		$("#m_marriage").select({
		    title: "请选择您的婚况",
		    items: vm.marriage_data,
		    onChange: function(result){
            	vm.m_marriage_id = result.values;
        	},
		});

		$("#income").select({
		    title: "请选择收入范围",
		    items: vm.income_data,
		    onChange: function(result){
            	console.log(result.values);
            	vm.income_id = result.values;
        	},
		});

		$("#m_income").select({
		    title: "请选择收入范围",
		    items: vm.income_data,
		    onChange: function(result){
            	console.log(result.values);
      			vm.m_income_id = result.values;
        	},
		});

		$("#worker").select({
		    title: "请选择职业",
		    items: vm.worker_data,
		    onChange: function(result){
            	console.log(result.values);
            	vm.worker_id = result.values;
        	},
		});

		$("#m_worker").select({
		    title: "请选择职业",
		    items: vm.worker_data,
		    onChange: function(result){
            	console.log(result.values);
          		vm.m_worker_id = result.values;
        	},
		});

		$("#car").select({
		    title: "请选择车辆情况",
		    items: vm.car_data,
		    onChange: function(result){
            	vm.car_id = result.values;
        	},
		});

		$("#m_car").select({
		    title: "请选择车辆情况",
		    items: vm.car_data,
		    onChange: function(result){
            	vm.m_car_id = result.values;
        	},
		});

		$("#house").select({
		    title: "请选择房屋情况",
		    items: vm.house_data,
		    onChange: function(result){
            	console.log(result.values);
            	vm.house_id = result.values;
        	},
		});

		$("#m_house").select({
		    title: "请选择房屋情况",
		    items: vm.house_data,
		    onChange: function(result){
            	console.log(result.values);
            	vm.m_house_id = result.values;
        	},
		});

		$("#m_height").select({
		    title: "请选择身高",
		    items: vm.height_data,
		    onChange: function(result){
				vm.m_height_id = result.values;
        	},
		});

		$("#m_age").select({
		    title: "请选择年龄情况",
		    items: vm.age_data,
		    onChange: function(result){
            	vm.m_age_id = result.values;
        	},
		});
		$('.info_show').on('click', function(event) {
			console.log($(this));
			var index = $(this).index();
			$('.info_show').removeClass('active');
			$(this).addClass('active');
			if(index==0){
				$(".my_info").show();
				$(".my_mate").hide();
				$(".my_other").hide();
			}
			if(index==1){
				$(".my_info").hide();
				$(".my_mate").show();
				$(".my_other").hide();
			}
			if(index==2){
				$(".my_info").hide();
				$(".my_mate").hide();
				$(".my_other").show();
			}
		});
		// function uplaod(){
			var allowTypes = ['image/jpg', 'image/jpeg', 'image/png', 'image/gif'];
	        var maxSize = 1024 * 1024*10; // 10240KB，也就是 10MB
	        var maxWidth = 1900;  // 图片最大宽度
	        var maxCount = 5;// 最大上传图片数量
	        var tmpl = '<div class="weui-uploader__input-box1" id="#ImgID#" style="background-image:url(#url#);background-size:100% 100%;background-repeat:no-repeat;"><div class="weui_uploader_status_content">0%</div></div>',
	        $gallery = $("#gallery"),
	        $galleryImg = $("#galleryImg"),
	        $uploaderInput = $("#uploaderInput"),
	        $uploaderFiles = $("#uploaderFiles");
	        $uploaderInput.on("change", function (e) {
	            files = e.target.files;
	            // 如果没有选中文件，直接返回
	            if (files.length === 0) {
	                return;
	            }
	            for (var i = 0, len = files.length; i < len; ++i) {
	                var file = files[i];
	                var imgID = genGUID();
	                var reader = new FileReader();
	                var fileType = file.type;
	                // 如果类型不在允许的类型范围内
	                if (allowTypes.indexOf(file.type) === -1) {
	                    
	                    $.toast('该类型不允许上传' + fileType, "forbidden");
	                    continue;
	                }
	                if (file.size > maxSize) {
	                    $.toast("图片太大，不允许上传", "forbidden");
	                    continue;
	                }
	                if ($('.weui-uploader__input-box1').length >= maxCount) {
	                    $.toast('最多只能上传' + maxCount + '张图片', "forbidden");
	                    return;
	                }
	                reader.onload = function (e) {
	                    var img = new Image();
	                    img.onload = function () {
	                        // 不要超出最大宽度
	                        var w = Math.min(maxWidth, img.width);
	                        // 高度按比例计算
	                        var h = img.height * (w / img.width);
	                        var canvas = document.createElement('canvas');
	                        var ctx = canvas.getContext('2d');
	                        // 设置 canvas 的宽度和高度
	                        canvas.width = w;
	                        canvas.height = h;
	                        ctx.drawImage(img, 0, 0, w, h);
	                        var base64 = canvas.toDataURL(fileType,0.6); //0.6指的是压缩60%
	                        // 插入到预览区
	                        $uploaderFiles.append($(tmpl.replace('#url#', base64).replace('#ImgID#',imgID)));
	                        var num = $('.weui-uploader__input-box1').length;
	                        $('#uploadCount').text(num);
	                        // 模拟上传进度
	                        var progress = 0;
	                        function uploading() {
	                            $uploaderFiles.find('.weui_uploader_status_content').text(++progress + '%');
	                            if (progress < 100) {
	                                setTimeout(uploading, 30);
	                            } else {
	                                $uploaderFiles.removeClass('weui_uploader_status').find('.weui_uploader_status_content').remove();//清除上传进度图标
	                            }
	                        }
	                        setTimeout(uploading, 30);
	                    };
	                    img.src = e.target.result;
	                    console.log(214325235);
	                    //console.log(img.src);return;
	                    //这里实现上传
	  　　　　　　　　　　      $.ajax({
						  	url: "{:url('api/Upload/processImg')}",
						  	type: 'post',
						  	dataType: 'json',
						  	data: {'file':img.src},
						  	success:function(e){
						  		console.log(e);
						  		vm.images.push(e);
						  		console.log('图片');
						  		$("#"+imgID).remove();
						  		// console.log(vm.images);
						  		// console.log("#"+imgID);
						  	},
						  	error:function(e){
						  		console.log(123321);
						  	}
						})
	  

	            };
	            reader.readAsDataURL(file);

	            }
	        })
	    // }



        var index; //第几张图片
        $uploaderFiles.on("click", "div", function () {
            index = $(this).index();
            $galleryImg.attr("style", this.getAttribute("style"));
            $galleryImg.css("background-size",'');
            $gallery.fadeIn(100);
        });
        $gallery.on("click", function () {
            $gallery.fadeOut(100);
        });

        //删除图片
        $(".weui-gallery__del").click(function () {
            $uploaderFiles.find("div").eq(index).remove();
            var num = $('.weui-uploader__file').length;
            $('#uploadCount').text(num);
        });



        $("#btnsaveCharge").click(function () {
            

            //或者在这里实现批量上传, 不建议批量上传
        });

	  //生成guid
	    function genGUID() {
	        var G1 = (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
	        var G2 = (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
	        return (G1 + G2);
	    }

	});
</script>
{/block}